﻿using System;
using HoangPhap.Bussiness;


namespace HoangPhap.Admin.CharityProgramCategory
{
    public partial class Create : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["USER"] == null) { Response.Redirect("login.aspx"); }
            //else
            //{
            //    if (Common.CheckPermission(Common.GetPermission(Session["USER"].ToString()), "SYSADMIN") == false)
            //    {
            //        Response.Redirect("error_info.aspx?err=permission");
            //    }
            //}
            var lst = new Language().SelectAll();

            LanguageTab.Text = "<ul>";
            foreach (var item in lst)
            {
                LanguageTab.Text += "<li><a href=\"#tabs-\">" + item.Name + "</a></li>";
            }
            LanguageTab.Text = "</ul>";

        }
        protected void btnADD_Click(object sender, EventArgs e)
        {
            //int nCategoryParentID = ConvertUtility.ToInt32(CategoryID.SelectedValue);
            //string sCategoryName = CategoryName.Value;
            //string sCategoryText = "";
            //string sCategoryOrder = CategoryOrder.Value;

            //int nDisplay = 0;
            //if (Display.Checked) nDisplay = 1;
            //int nCategoryLevel = 0;

            //string sSQL = "";

            //if (nCategoryParentID == 0)
            //{
            //    sCategoryText = sCategoryName;
            //    nCategoryLevel = 1;
            //}
            //else
            //{
            //    sSQL = "select CategoryText,CategoryLevel from Categories where CategoryID = " + nCategoryParentID;
            //    DataTable dt = DataHelper.SelectTable(sSQL, false);
            //    if (dt.Rows.Count > 0)
            //    {
            //        sCategoryText = dt.Rows[0]["CategoryText"].ToString() + " - " + sCategoryName;
            //        nCategoryLevel = Convert.ToInt32(dt.Rows[0]["CategoryLevel"]) + 1;
            //    }
            //}

            ////sSQL = "INSERT INTO Categories (CategoryName, CategoryText, CategoryParentID, CategoryLevel,IsDisplay, CategoryOrder) VALUES ";
            //sSQL = "INSERT INTO Categories (CategoryName, CategoryText, CategoryParentID, CategoryLevel, CategoryOrder) VALUES ";
            //sSQL += "(N'" + Common.SQLPatch(sCategoryName) + "',";
            //sSQL += "N'" + Common.SQLPatch(sCategoryText) + "',";
            //sSQL += nCategoryParentID + ",";
            //sSQL += nCategoryLevel + ",";
            ////sSQL += nDisplay + ",";
            //sSQL += "'" + Common.SQLPatch(sCategoryOrder) + "')";

            //DataHelper.ExecuteNonQuery(sSQL, true);

            //Response.Redirect("category_list.aspx");

        }
    }
}